package org.fer.source;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.ImageButton;

public class MainActivity extends Activity {

	public static final String KEY_NAME = "response_name";
	public static final String KEY_ADDRESS = "response_address";
	public static final String KEY_PHONE = "response_phone";
	public static final String KEY_BIRTH = "response_birth";

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		ImageButton buttonSend = (ImageButton) this.findViewById(R.id.button1);

		buttonSend.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View view) {
				Intent intent = new Intent(view.getContext(),
						ResponseActivity.class);

				EditText nombre = (EditText) findViewById(R.id.etName);
				EditText direccion = (EditText) findViewById(R.id.etAddress);
				EditText telefono = (EditText) findViewById(R.id.etPhone);
				EditText fechaNac = (EditText) findViewById(R.id.etBirth);

				intent.putExtra(KEY_NAME, nombre.getText().toString());
				intent.putExtra(KEY_ADDRESS, direccion.getText().toString());
				intent.putExtra(KEY_PHONE, telefono.getText().toString());
				intent.putExtra(KEY_BIRTH, fechaNac.getText().toString());

				startActivity(intent);

			}
		});

	}
}